home *** CD-ROM | disk | FTP | other *** search
- unit DrBob42X;
- interface
- uses
- Classes, HTTPApp, WebComp, MidItems;
-
- type
- TWebCheckbox = class(TWebTextInput)
- protected
- function ControlContent(Options: TWebContentOptions): string; override;
- published
- property DisplayWidth;
- property ReadOnly;
- property Caption;
- property CaptionAttributes;
- property CaptionPosition;
- property TabIndex;
- property Style;
- property Custom;
- property StyleRule;
- end;
-
- TQueryCheckbox = class(TWebCheckbox, IQueryField)
- private
- FText: string;
- protected
- function GetText: string;
- procedure SetText(const Value: string);
- public
- class function IsQueryField: Boolean; override;
- end;
-
- procedure Register;
-
- implementation
- uses
- SysUtils;
-
- { TWebCheckbox }
-
- function TWebCheckbox.ControlContent(Options: TWebContentOptions): string;
- var
- Attrs: string;
- begin
- AddAttributes(Attrs);
- Result := Format('<INPUT TYPE=CHECKBOX %0:s>', [Attrs]);
- end;
-
- { TQueryCheckbox }
-
- class function TQueryCheckbox.IsQueryField: Boolean;
- begin
- Result := True;
- end;
-
- function TQueryCheckbox.GetText: string;
- begin
- Result := FText;
- end;
-
- procedure TQueryCheckbox.SetText(const Value: string);
- begin
- FText := Value;
- end;
-
- { Register procedure }
-
- procedure Register;
- begin
- RegisterWebComponents([TWebCheckBox,TQueryCheckbox]);
- end;
-
- end.
-
-